using System;
using System.Collections;
using System.IO;
using System.Linq;
using OracleInternal.Network;

namespace OracleInternal.Common
{
	internal class SqlNetOraConfig
	{
		private const string SSL_CLIENT_AUTHENTICATION = "ssl_client_authentication";

		internal const string SSL_SERVER_DN_MATCH = "ssl_server_dn_match";

		internal const string SSL_VERSION = "ssl_version";

		private const string SSL_CIPHER_SUITES = "ssl_cipher_suites";

		internal const string SQLNET_AUTHENTICATION_SERVICES = "sqlnet.authentication_services";

		internal const string SQLNET_ENCRYPTION_TYPES_CLIENT = "sqlnet.encryption_types_client";

		internal const string SQLNET_ENCRYPTION_CLIENT = "sqlnet.encryption_client";

		internal const string SQLNET_CRYPTO_CHECKSUM_TYPES_CLIENT = "sqlnet.crypto_checksum_types_client";

		internal const string SQLNET_CRYPTO_CHECKSUM_CLIENT = "sqlnet.crypto_checksum_client";

		internal const string NAMES_DIRECTORY_PATH = "names.directory_path";

		internal const string WALLET_LOCATION = "wallet_location";

		internal const string DISABLE_OOB = "disable_oob";

		internal const string NODELAY = "nodelay";

		internal const string SBS = "send_buf_size";

		internal const string RBS = "recv_buf_size";

		internal const string NAMES_DEFAULT_DOMAIN = "names.default_domain";

		private const string TRACE_LEVEL_CLIENT = "trace_level_client";

		private const string TRACE_UNIQUE_CLIENT = "trace_unique_client";

		internal const string TCP_NODELAY = "tcp.nodelay";

		internal const string TCP_CONNECT_TIMEOUT = "tcp.connect_timeout";

		internal const string DEFAULT_SERVICE_IS_HOST = "hostname.default_service_is_host";

		internal const string NAMES_LDAP_AUTHENTICATE_BIND = "names.ldap_authenticate_bind";

		internal const string NAMES_LDAP_CONN_TIMEOUT = "names.ldap_conn_timeout";

		internal const string SQLNET_KERBEROS5_CONF = "sqlnet.kerberos5_conf";

		internal const string SQLNET_KERBEROS5_CC_NAME = "sqlnet.kerberos5_cc_name";

		internal const string SQLNET_WALLET_OVERRIDE = "sqlnet.wallet_override";

		internal const string SQLNET_EXPIRE_TIME = "sqlnet.expire_time";

		internal const string SQLNET_URI = "sqlnet.uri";

		private const char chSingleQuote = '\'';

		private const char chDoubleQuote = '"';

		private readonly char[] trimChars = new char[2]
		{
			'\'',
			'"'
		};

		private string m_ExpireTime = "";

		private bool m_ExpireTime_accessed;

		private bool m_bDisableOOB;

		private bool m_bDisableOOB_accessed;

		private bool m_bNoDelay = true;

		private bool m_bNoDelay_accessed;

		private int m_SBS;

		private bool m_SBS_accessed;

		private int m_RBS;

		private bool m_RBS_accessed;

		private string m_sslVersion = "0";

		private bool m_bSSLVersion_accessed;

		private bool m_bSSLServerDNMatch;

		private bool m_bSSLServerDNMatch_accessed;

		private bool m_bSSLClientAuthentication = true;

		private bool m_bSSLClientAuthentication_accessed = true;

		private bool m_bTCPNoDelay = true;

		private bool m_bTCPNoDelay_accessed;

		private string m_TCPCTimeOut = "60";

		private bool m_TCPCTimeOut_accessed;

		private bool m_DefaultServiceIsHost;

		private bool m_DefaultServiceIsHost_accessed;

		private static string[] m_sslCipherSuites = new string[11]
		{
			"SSL_RSA_WITH_3DES_EDE_CBC_SHA",
			"SSL_RSA_WITH_RC4_128_SHA",
			"SSL_RSA_WITH_RC4_128_MD5",
			"SSL_RSA_WITH_DES_CBC_SHA",
			"SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
			"SSL_DH_anon_WITH_RC4_128_MD5",
			"SSL_DH_anon_WITH_DES_CBC_SHA",
			"SSL_RSA_EXPORT_WITH_RC4_40_MD5",
			"SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
			"SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
			"SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA"
		};

		private bool m_bSSLCipherSuites_accessed;

		private string[] m_sqlNetAuthenticationServices;

		internal bool m_bSqlNetAuthenticationServices_accessed;

		private string[] m_sqlNetEncryptionTypesClient;

		internal bool m_bSqlNetEncryptionTypesClient_accessed;

		private string m_sqlNetEncryptionClient;

		private bool m_bSqlNetEncryptionClient_accessed;

		private string[] m_sqlNetCryptoChecksumTypesClient;

		internal bool m_bSqlNetCryptoChecksumTypesClient_accessed;

		private string m_sqlNetCryptoChecksumClient;

		private bool m_bSqlNetCryptoChecksumClient_accessed;

		private string m_namesDefaultDomain;

		private bool m_bNamesDefaultDomain_accessed;

		private static string[] m_namesDirectoryPath_def = new string[2]
		{
			"tnsnames",
			"hostname"
		};

		private string[] m_namesDirectoryPath = m_namesDirectoryPath_def;

		internal bool m_bNamesDirectoryPath_accessed;

		private static bool m_bWalletOverride = false;

		private static bool m_bWalletOverride_accessed = false;

		internal string m_walletLocation;

		internal bool m_walletLocation_accessed;

		internal string m_traceLevelClient = "off";

		internal bool m_bTraceLevelClient_accessed;

		internal bool m_bTraceUniqueClient = true;

		internal bool m_bTraceUniqueClient_accessed;

		private static bool m_bNamesLdapAuthenticateBind = false;

		private static bool m_bNamesLdapAuthenticateBind_accessed = false;

		private static int m_LDAPCTimeOut = 15;

		private static bool m_LDAPCTimeOut_accessed = false;

		private string m_traceDirectoryClient = string.Empty;

		internal string m_sqlNetURI = "sqlnet";

		internal bool m_sqlNetURI_accessed;

		internal Hashtable m_ConfigHT;

		internal string this[string key] => m_ConfigHT[key] as string;

		internal bool SSLClientAuthentication
		{
			get
			{
				if (!m_bSSLClientAuthentication_accessed)
				{
					string text = m_ConfigHT["ssl_client_authentication"] as string;
					if (!string.IsNullOrEmpty(text))
					{
						m_bSSLClientAuthentication = ParamValueIsTrue(text);
					}
					m_bSSLClientAuthentication_accessed = true;
				}
				return m_bSSLClientAuthentication;
			}
			set
			{
				ConfigBaseClass.m_configParameters["ssl_client_authentication"] = value;
				ConfigBaseClass.m_oracleConfigParameters["ssl_client_authentication"] = value;
				m_bSSLClientAuthentication_accessed = false;
			}
		}

		internal bool SSLServerDNMatch
		{
			get
			{
				getBoolValue("ssl_server_dn_match", ref m_bSSLServerDNMatch, m_ConfigHT, ref m_bSSLServerDNMatch_accessed);
				return m_bSSLServerDNMatch;
			}
			set
			{
				ConfigBaseClass.m_configParameters["ssl_server_dn_match"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["ssl_server_dn_match"] = value.ToString();
				m_bSSLServerDNMatch_accessed = false;
			}
		}

		internal string SSLVersion
		{
			get
			{
				getStrValue("ssl_version", ref m_sslVersion, m_ConfigHT, ref m_bSSLVersion_accessed);
				return m_sslVersion;
			}
			set
			{
				ConfigBaseClass.m_configParameters["ssl_version"] = value;
				ConfigBaseClass.m_oracleConfigParameters["ssl_version"] = value;
				m_bSSLVersion_accessed = false;
			}
		}

		internal string[] SSLCipherSuites
		{
			get
			{
				if (!m_bSSLCipherSuites_accessed)
				{
					string text = m_ConfigHT["ssl_cipher_suites"] as string;
					if (!string.IsNullOrEmpty(text) && text[0] == '(' && text[text.Length - 1] == ')')
					{
						m_sslCipherSuites = (from s in text.Substring(1, text.Length - 2).Split(new char[1]
							{
								','
							})
							select s.Trim() into s
							where s != string.Empty
							select s).ToArray();
					}
					m_bSSLCipherSuites_accessed = true;
				}
				return m_sslCipherSuites;
			}
		}

		internal string[] SqlNetAuthenticationServices
		{
			get
			{
				if (!m_bSqlNetAuthenticationServices_accessed)
				{
					m_sqlNetAuthenticationServices = MultipleValueSplit(m_ConfigHT["sqlnet.authentication_services"] as string);
					m_bSqlNetAuthenticationServices_accessed = true;
				}
				return m_sqlNetAuthenticationServices;
			}
		}

		internal string[] SqlNetEncryptionTypesClient
		{
			get
			{
				if (!m_bSqlNetEncryptionTypesClient_accessed)
				{
					string text = m_ConfigHT["sqlnet.encryption_types_client"] as string;
					if (!string.IsNullOrEmpty(text) && text[0] == '(' && text[text.Length - 1] == ')')
					{
						string text2 = text.Substring(1, text.Length - 2);
						m_sqlNetEncryptionTypesClient = (from s in text2.Split(new char[1]
							{
								','
							})
							select s.Trim() into s
							where s != string.Empty
							select s).ToArray();
					}
					m_bSqlNetEncryptionTypesClient_accessed = true;
				}
				return m_sqlNetEncryptionTypesClient;
			}
		}

		internal string SqlNetEncryptionClient
		{
			get
			{
				getStrValue("sqlnet.encryption_client", ref m_sqlNetEncryptionClient, m_ConfigHT, ref m_bSqlNetEncryptionClient_accessed);
				return m_sqlNetEncryptionClient;
			}
			set
			{
				ConfigBaseClass.m_configParameters["sqlnet.encryption_client"] = value;
				ConfigBaseClass.m_oracleConfigParameters["sqlnet.encryption_client"] = value;
				m_bSqlNetEncryptionClient_accessed = false;
			}
		}

		internal string[] SqlNetCryptoChecksumTypesClient
		{
			get
			{
				if (!m_bSqlNetCryptoChecksumTypesClient_accessed)
				{
					string text = m_ConfigHT["sqlnet.crypto_checksum_types_client"] as string;
					if (!string.IsNullOrEmpty(text) && text[0] == '(' && text[text.Length - 1] == ')')
					{
						string text2 = text.Substring(1, text.Length - 2);
						m_sqlNetCryptoChecksumTypesClient = (from s in text2.Split(new char[1]
							{
								','
							})
							select s.Trim() into s
							where s != string.Empty
							select s).ToArray();
					}
					m_bSqlNetCryptoChecksumTypesClient_accessed = true;
				}
				return m_sqlNetCryptoChecksumTypesClient;
			}
		}

		internal string SqlNetCryptoChecksumClient
		{
			get
			{
				getStrValue("sqlnet.crypto_checksum_client", ref m_sqlNetCryptoChecksumClient, m_ConfigHT, ref m_bSqlNetCryptoChecksumClient_accessed);
				return m_sqlNetCryptoChecksumClient;
			}
			set
			{
				ConfigBaseClass.m_configParameters["sqlnet.crypto_checksum_client"] = value;
				ConfigBaseClass.m_oracleConfigParameters["sqlnet.crypto_checksum_client"] = value;
				m_bSqlNetCryptoChecksumClient_accessed = false;
			}
		}

		internal string[] NamesDirectoryPath
		{
			get
			{
				if (!m_bNamesDirectoryPath_accessed)
				{
					string text = m_ConfigHT["names.directory_path"] as string;
					if (!string.IsNullOrEmpty(text) && text[0] == '(' && text[text.Length - 1] == ')')
					{
						string text2 = text.Substring(1, text.Length - 2);
						m_namesDirectoryPath = (from s in text2.Split(',')
							select s.Trim() into s
							where s != string.Empty
							select s).ToArray();
					}
					m_bNamesDirectoryPath_accessed = true;
				}
				return m_namesDirectoryPath;
			}
		}

		internal string WalletLocation
		{
			get
			{
				getStrValue("wallet_location", ref m_walletLocation, m_ConfigHT, ref m_walletLocation_accessed);
				return m_walletLocation;
			}
		}

		internal bool DisableOOB
		{
			get
			{
				getBoolValue("disable_oob", ref m_bDisableOOB, m_ConfigHT, ref m_bDisableOOB_accessed);
				return m_bDisableOOB;
			}
			set
			{
				ConfigBaseClass.m_configParameters["disable_oob"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["disable_oob"] = value.ToString();
				m_bDisableOOB_accessed = false;
			}
		}

		internal bool NoDelay
		{
			get
			{
				getBoolValue("nodelay", ref m_bNoDelay, m_ConfigHT, ref m_bNoDelay_accessed);
				return m_bNoDelay;
			}
			set
			{
				ConfigBaseClass.m_configParameters["nodelay"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["nodelay"] = value.ToString();
				m_bNoDelay_accessed = false;
			}
		}

		internal string NamesDefaultDomain
		{
			get
			{
				if (!m_bNamesDefaultDomain_accessed)
				{
					string text = m_ConfigHT["names.default_domain"] as string;
					if (!string.IsNullOrEmpty(text))
					{
						m_namesDefaultDomain = text;
					}
					m_bNamesDefaultDomain_accessed = true;
				}
				return m_namesDefaultDomain;
			}
			set
			{
				ConfigBaseClass.m_configParameters["names.default_domain"] = value;
				ConfigBaseClass.m_oracleConfigParameters["names.default_domain"] = value;
				m_bNamesDefaultDomain_accessed = false;
			}
		}

		internal string TraceLevelClient
		{
			get
			{
				if (!m_bTraceLevelClient_accessed)
				{
					m_traceLevelClient = m_ConfigHT["trace_level_client"] as string;
					m_bTraceLevelClient_accessed = true;
				}
				return m_traceLevelClient;
			}
			set
			{
				ConfigBaseClass.m_configParameters["trace_level_client"] = value;
				ConfigBaseClass.m_oracleConfigParameters["trace_level_client"] = value;
				m_bTraceLevelClient_accessed = false;
			}
		}

		internal bool TraceUniqueClient
		{
			get
			{
				if (!m_bTraceUniqueClient_accessed)
				{
					string text = m_ConfigHT["trace_unique_client"] as string;
					if (!string.IsNullOrEmpty(text))
					{
						m_bTraceUniqueClient = ParamValueIsTrue(text);
					}
					m_bTraceUniqueClient_accessed = true;
				}
				return m_bTraceUniqueClient;
			}
			set
			{
				ConfigBaseClass.m_configParameters["trace_unique_client"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["trace_unique_client"] = value.ToString();
				m_bTraceUniqueClient_accessed = false;
			}
		}

		internal bool TCPNoDelay
		{
			get
			{
				getBoolValue("tcp.nodelay", ref m_bTCPNoDelay, m_ConfigHT, ref m_bTCPNoDelay_accessed);
				return m_bTCPNoDelay;
			}
			set
			{
				ConfigBaseClass.m_configParameters["tcp.nodelay"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["tcp.nodelay"] = value.ToString();
				m_bTCPNoDelay_accessed = false;
			}
		}

		internal bool WalletOverride
		{
			get
			{
				getBoolValue("sqlnet.wallet_override", ref m_bWalletOverride, m_ConfigHT, ref m_bWalletOverride_accessed);
				return m_bWalletOverride;
			}
			set
			{
				ConfigBaseClass.m_configParameters["sqlnet.wallet_override"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["sqlnet.wallet_override"] = value.ToString();
				m_bWalletOverride_accessed = false;
			}
		}

		internal int SendBufSize
		{
			get
			{
				getIntValue("send_buf_size", ref m_SBS, m_ConfigHT, ref m_SBS_accessed);
				return m_SBS;
			}
			set
			{
				ConfigBaseClass.m_configParameters["send_buf_size"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["send_buf_size"] = value.ToString();
				m_SBS_accessed = false;
			}
		}

		internal int RecvBufSize
		{
			get
			{
				getIntValue("recv_buf_size", ref m_RBS, m_ConfigHT, ref m_RBS_accessed);
				return m_RBS;
			}
			set
			{
				ConfigBaseClass.m_configParameters["recv_buf_size"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["recv_buf_size"] = value.ToString();
				m_RBS_accessed = false;
			}
		}

		internal string TCPCTimeOut
		{
			get
			{
				getStrValue("tcp.connect_timeout", ref m_TCPCTimeOut, m_ConfigHT, ref m_TCPCTimeOut_accessed);
				return m_TCPCTimeOut;
			}
			set
			{
				ConfigBaseClass.m_configParameters["tcp.connect_timeout"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["tcp.connect_timeout"] = value.ToString();
				m_TCPCTimeOut_accessed = false;
			}
		}

		internal bool HostnameDefaultServiceIsHost
		{
			get
			{
				getBoolValue("hostname.default_service_is_host", ref m_DefaultServiceIsHost, m_ConfigHT, ref m_DefaultServiceIsHost_accessed);
				return m_DefaultServiceIsHost;
			}
			set
			{
				ConfigBaseClass.m_configParameters["hostname.default_service_is_host"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["hostname.default_service_is_host"] = value.ToString();
				m_DefaultServiceIsHost_accessed = false;
			}
		}

		internal bool NamesLdapAuthenticateBind
		{
			get
			{
				getBoolValue("names.ldap_authenticate_bind", ref m_bNamesLdapAuthenticateBind, m_ConfigHT, ref m_bNamesLdapAuthenticateBind_accessed);
				return m_bNamesLdapAuthenticateBind;
			}
			set
			{
				ConfigBaseClass.m_configParameters["names.ldap_authenticate_bind"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["names.ldap_authenticate_bind"] = value.ToString();
				m_bNamesLdapAuthenticateBind_accessed = false;
			}
		}

		internal int LDAPCTimeout
		{
			get
			{
				getIntValue("names.ldap_conn_timeout", ref m_LDAPCTimeOut, m_ConfigHT, ref m_LDAPCTimeOut_accessed);
				return m_LDAPCTimeOut;
			}
			set
			{
				ConfigBaseClass.m_configParameters["names.ldap_conn_timeout"] = value.ToString();
				ConfigBaseClass.m_oracleConfigParameters["names.ldap_conn_timeout"] = value.ToString();
				m_LDAPCTimeOut_accessed = false;
			}
		}

		internal string ExpireTime
		{
			get
			{
				getStrValue("sqlnet.expire_time", ref m_ExpireTime, m_ConfigHT, ref m_ExpireTime_accessed);
				return m_ExpireTime;
			}
			set
			{
				ConfigBaseClass.m_configParameters["sqlnet.expire_time"] = value;
				ConfigBaseClass.m_oracleConfigParameters["sqlnet.expire_time"] = value;
				m_ExpireTime_accessed = false;
			}
		}

		internal string SQLNetURI
		{
			get
			{
				if (!m_sqlNetURI_accessed)
				{
					string text = m_ConfigHT["sqlnet.uri"] as string;
					if (!string.IsNullOrEmpty(text))
					{
						if (text[0] == '\'' || text[0] == '"')
						{
							m_sqlNetURI = text.Trim(trimChars);
						}
						else
						{
							m_sqlNetURI = text;
						}
					}
					m_sqlNetURI_accessed = true;
				}
				return m_sqlNetURI;
			}
		}

		internal SqlNetOraConfig(Hashtable ConfigHT)
		{
			m_ConfigHT = ConfigHT;
		}

		internal SqlNetOraConfig()
		{
			m_ConfigHT = ConfigBaseClass.m_configParameters;
		}

		internal static void getIntValue(string Name, ref int Value, Hashtable HT, ref bool accessed)
		{
			try
			{
				if (!accessed)
				{
					string text = HT[Name] as string;
					if (!string.IsNullOrEmpty(text))
					{
						Value = int.Parse(text);
					}
					accessed = true;
				}
			}
			catch (Exception)
			{
			}
		}

		internal static void getStrValue(string Name, ref string Value, Hashtable HT, ref bool accessed)
		{
			try
			{
				if (!accessed)
				{
					string text = HT[Name] as string;
					if (!string.IsNullOrEmpty(text))
					{
						Value = text;
					}
					accessed = true;
				}
			}
			catch (Exception)
			{
			}
		}

		internal static void getBoolValue(string Name, ref bool Value, Hashtable HT, ref bool accessed)
		{
			try
			{
				if (!accessed)
				{
					string text = HT[Name] as string;
					if (!string.IsNullOrEmpty(text))
					{
						Value = ParamValueIsTrue(text);
					}
					accessed = true;
				}
			}
			catch (Exception)
			{
			}
		}

		internal static string[] MultipleValueSplit(string value)
		{
			(new string[1])[0] = value;
			if (string.IsNullOrEmpty(value))
			{
				return null;
			}
			value = value.Trim();
			value = value.Trim('(', ')');
			return (from s in value.Split(new char[1]
				{
					','
				})
				select s.Trim() into s
				where s != string.Empty
				select s).ToArray();
		}

		internal static Hashtable ParseWalletLocation(string wallet_location)
		{
			NVPair nVPair = NVFactory.CreateNVPair(wallet_location);
			Hashtable hashtable = null;
			if (nVPair != null)
			{
				NVPair nVPair2 = NVNavigator.FindNVPairRecurse(nVPair, "SOURCE");
				if (nVPair2 != null)
				{
					NVPair nVPair3 = NVNavigator.FindNVPair(nVPair2, "METHOD");
					if (nVPair3 != null)
					{
						hashtable = new Hashtable(5);
						hashtable["METHOD"] = nVPair3.Atom;
						NVPair nVPair4 = NVNavigator.FindNVPair(nVPair2, "METHOD_DATA");
						if (nVPair4 != null)
						{
							hashtable["METHOD"] = nVPair3.Atom.ToUpperInvariant();
							switch (nVPair3.Atom.ToUpperInvariant())
							{
							case "FILE":
							{
								NVPair nVPair8 = NVNavigator.FindNVPair(nVPair4, "DIRECTORY");
								if (nVPair8 != null)
								{
									hashtable["DIRECTORY"] = nVPair8.Atom;
								}
								break;
							}
							case "REG":
							{
								NVPair nVPair7 = NVNavigator.FindNVPair(nVPair4, "KEY");
								if (nVPair7 != null)
								{
									hashtable["KEY"] = nVPair7.Atom;
								}
								break;
							}
							case "ENTR":
							{
								NVPair nVPair5 = NVNavigator.FindNVPair(nVPair4, " ");
								if (nVPair5 != null)
								{
									hashtable[nVPair5.Name] = nVPair5.Atom;
								}
								NVPair nVPair6 = NVNavigator.FindNVPair(nVPair4, "INIFILE");
								if (nVPair6 != null)
								{
									hashtable[nVPair6.Name] = nVPair6.Atom;
								}
								break;
							}
							}
						}
					}
				}
			}
			return hashtable;
		}

		internal static void GetWalletLoc(ConnectionOption conOption, SqlNetOraConfig SNOConfig, out string Dir, out Hashtable HT)
		{
			Dir = null;
			HT = null;
			if (conOption != null && !string.IsNullOrEmpty(conOption.SSL_WALLET_DIRECTORY))
			{
				Dir = conOption.SSL_WALLET_DIRECTORY.Trim();
			}
			else
			{
				Dir = SNOConfig.WalletLocation;
			}
			if (!string.IsNullOrEmpty(Dir))
			{
				Dir = Dir.Trim();
				if (Dir.IndexOf('(') == 0)
				{
					HT = ParseWalletLocation(Dir);
					Dir = null;
				}
			}
		}

		internal static bool ParamValueIsTrue(string paramValue)
		{
			if (string.Compare(paramValue, "1", StringComparison.InvariantCultureIgnoreCase) != 0 && string.Compare(paramValue, "on", StringComparison.InvariantCultureIgnoreCase) != 0 && string.Compare(paramValue, "yes", StringComparison.InvariantCultureIgnoreCase) != 0)
			{
				return string.Compare(paramValue, "true", StringComparison.InvariantCultureIgnoreCase) == 0;
			}
			return true;
		}

		internal static string HandlePathSeparators(string WalletDirectory)
		{
			switch (Path.DirectorySeparatorChar)
			{
			case '\\':
				WalletDirectory = WalletDirectory.Replace('/', Path.DirectorySeparatorChar);
				break;
			case '/':
				WalletDirectory = WalletDirectory.Replace('\\', Path.DirectorySeparatorChar);
				break;
			}
			if (!WalletDirectory.EndsWith(Path.DirectorySeparatorChar.ToString() ?? ""))
			{
				WalletDirectory += Path.DirectorySeparatorChar;
			}
			return WalletDirectory;
		}

		internal void ResetAccessFlags()
		{
			m_bDisableOOB_accessed = false;
			m_bNoDelay_accessed = false;
			m_SBS_accessed = false;
			m_RBS_accessed = false;
			m_bSSLVersion_accessed = false;
			m_bSSLServerDNMatch_accessed = false;
			m_bSSLClientAuthentication_accessed = false;
			m_bTCPNoDelay_accessed = false;
			m_TCPCTimeOut_accessed = false;
			m_DefaultServiceIsHost_accessed = false;
			m_bSSLCipherSuites_accessed = false;
			m_bSqlNetAuthenticationServices_accessed = false;
			m_bSqlNetEncryptionTypesClient_accessed = false;
			m_bSqlNetEncryptionClient_accessed = false;
			m_bSqlNetCryptoChecksumTypesClient_accessed = false;
			m_bSqlNetCryptoChecksumClient_accessed = false;
			m_bNamesDefaultDomain_accessed = false;
			m_bNamesDirectoryPath_accessed = false;
			m_bWalletOverride_accessed = false;
			m_walletLocation_accessed = false;
			m_bTraceLevelClient_accessed = false;
			m_bTraceUniqueClient_accessed = false;
			m_bNamesLdapAuthenticateBind_accessed = false;
			m_LDAPCTimeOut_accessed = false;
		}
	}
}
